<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 用户地址
 */
class CreateUserAddress extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_address', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户主键ID');
            $table->string('province',6)->comment('省份');
            $table->string('city',6)->comment('城市');
            $table->string('area',6)->comment('地区');
            $table->string('district',100)->comment('详细地址');
            $table->string('userName',30)->comment('用户姓名');
            $table->string('phone',11)->comment('手机号码');
            $table->string('postalCode',11)->comment('邮政编码');
            $table->tinyInteger('isDefault')->default(0)->comment('是否默认地址 0=否 1=是');
            $table->timestamps();
            $table->timestamp('deleted_at')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('user_address');
    }
}
